--
-- Author: shineflag
-- Date: 2018-04-02 16:52:41
--

local skynet = require "skynet"
require "skynet.manager"
local json = require("json")
local log = require("log")
local cluster = require("skynet.cluster")


local TAG = "WEB_MAIN"


skynet.start(function()


	log.d(TAG,"Web Server start")
	local cname = skynet.getenv "cname"
	log.e(TAG,"cluster cname %s start", cname)
	cluster.open(cname)

	local host_conf = require("host_conf")
	if host_conf[cname]["debug_port"] then
		skynet.newservice("debug_console",host_conf[cname]["debug_port"] )
	end

	local logind = skynet.uniqueservice "web/logind"
	local webgate = skynet.uniqueservice("web/webgate",host_conf[cname]["port"])

	skynet.exit()
end)
